package lab02.Test34;

import java.util.*;

public class test {
    public static void main(String[] args) {

        List<String> list=new ArrayList<String>();

       list.add("apple");
       list.add("grape");
        list.add("pear");
        list.add("banana");

       String a= Collections.max(list);
       String b=Collections.min(list);
        System.out.println("最小值："+a);
        System.out.println("最大值："+b);
        for (String m:list){
           //list.add(m);
            System.out.println(m);
        }
        System.out.println("排序后的结果：");
        Collections.sort(list);
        for (String l:list) {
            System.out.println(l);
        }
    }
}
